<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>mousepos</title>
</head>
<body>

<pre><font size="4"><a href="../../index.htm">主页</a>-＞<a href="../index.htm">库函数目录</a>-＞<a href="index.htm">键盘鼠标输入函数</a>-＞mousepos</font>
<font size="4">
<font size="5" color="#0000FF"><strong>功能：</strong></font>
这个函数用于获取当前鼠标坐标。

<font size="5" color="#0000FF"><strong>声明：</strong></font>
<pre><font color=#0000FF>int </font><font color=#008080>mousepos</font>(<font color=#0000FF>int </font>*x, <font color=#0000FF>int </font>*y);</pre>
<font size="5" color="#0000FF"><strong>参数：</strong></font>
x
用来接收横坐标

y
用来接收纵坐标

<font size="5" color="#0000FF"><strong>返回值：</strong></font>
0

<font size="5" color="#0000FF"><strong>示例：</strong></font>
<pre>
<font color=#0000FF>if </font>(<font color=#008080>keystate</font>(<font color=#800080>key_mouse_l</font>)) { <font color=#008000>// 鼠标左键按下了</font>
    <font color=#008000>//获取鼠标当前位置坐标，放在变量mouse_x和mouse_y中 </font>
    <font color=#0000FF>int </font>mouse_x,mouse_y;
    <font color=#008080>mousepos</font>(&mouse_x,&mouse_y);
    <font color=#008000>//在鼠标当前位置画一个半径为100的圆</font>
    <font color=#008080>circle</font>(&mouse_x,&mouse_y,100);
}
</pre>


</font>
</pre>

</body>

